<!--
@Author: 赵明洋 3016214077

@Date: 2018-12-12

@员工请假状态查询界面

@Last Modified time: 2018-12-16-->
<div class="box">
  <div class="box-header">
    <h3 class="box-title">请假状态查询</h3>
    &nbsp;
    &nbsp;
    <a class="btn btn-success btn-sm" (click)="create()">
      <span class="glyphicon glyphicon-plus"></span>添加新申请
    </a>

    <!-- /.box-header -->
    <div class="box-body table-responsive no-padding">
      <table class="table table-hover">
        <tr>
          <th>申请编号</th>
          <th>申请员工编号</th>
          <th>请假开始时间</th>
          <th>请假结束时间</th>
          <th>请假天数</th>
          <th>请假类型</th>
          <th>当前状态</th>
          <th>操作</th>
        </tr>
        <tr *ngFor="let LeaveRequest of LeaveRequests ; let i = index;">
          <td>{{LeaveRequest.id}}</td>
          <td>{{LeaveRequest.user_id}}</td>
          <td>{{LeaveRequest.start_time}}</td>
          <td>{{LeaveRequest.end_time}}</td>
          <td>{{LeaveRequest.duration}}</td>
          <td><span class="badge bg-blue">{{selectType(LeaveRequest.type)}}</span></td>
          <td>{{selectState(LeaveRequest.state)}}</td>
          <td *ngIf="LeaveRequest.user_id == sid">
            <a class="btn btn-danger btn-sm" style="background:rgb(92, 179, 233);border: rgb(92, 179, 233)" (click)="lookSuggestion(LeaveRequest.suggestion)">查看审批意见</a>
            &nbsp;&nbsp;
            <a *ngIf="LeaveRequest.state != 1" class="btn btn-warning btn-xs" (click)="update(LeaveRequest)" style="margin-left: 25%">修改</a>
            &nbsp;
            <a *ngIf="LeaveRequest.state != 1" class="btn btn-danger btn-xs" (click)="delete(LeaveRequest)" style="margin-left: 2%">删除 </a>
          </td>
        </tr>

      </table>
    </div>
    <!-- /.box-body -->
  </div>
  <div id="popup" *ngIf="suggestion">
    <div class="bg">
      <div class="box box-primary" style="float:left;width: 55%;margin-left:25%;margin-top: 5%;text-align: center">
        <div class="box-body box-profile">
          <a class="btn btn-danger btn-xs" style="margin: 0 0 0 95%;" (click)="backSuggestion()">返回</a>
          <h3 class="profile-username text-center">审批意见</h3>

          <div style="white-space: pre-line;">
            <li class="list-group-item">
              <div>
                <textarea class="textarea" readonly="readonly" style="width: 100%; height: 500px; font-size: 14px; line-height: 18px; border: 1px solid #dddddd; padding: 10px;">
                    {{suggestion}}
                </textarea>
              </div>
            </li>
          </div>


        </div>
      </div>
    </div>